﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TzzbIndex.aspx.cs" Inherits="Xiaov.SmartWeb.Application.HXZB.Tzfx.TzzbIndex" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="/Resources/easyui-1.32/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="/Resources/xiaovcn/scripts/usercheck.js"></script>
    <script type="text/javascript" src="../../../SupCan/binary/dynaload.js?60"></script>
    <script type="text/javascript" language="javascript">
        var count=0;
        function OnReady(id) {
            count++;
            if (id == "AF") {
                form1.AF.func("Build", "TzzbIndex.xml");
                var xmlbid ="<%=xmlbid%>";
                var xmmc ="<%=xmmc%>";
                var nf ="<%=nf%>";
                var yf ="<%=yf%>";
                form1.AF.func("Load", "TzzbIndexData.aspx?xmlbid=" + escape(xmlbid) + "&xmmc=" + escape(xmmc) + "&nf=" + escape(nf) + "&yf=" + escape(yf));               
            }
            if (count==3) {
                var seriesname = <%=nf %>+"年<%=xmmc %>投资建议计划执行情况  （单位：万元）";
                var rows  = form1.AF.func("getRows", "") -1;
                var titles="", datas="";
                for(var col=form1.AF.func("GetNextValidCol", ""); col!=""; col=form1.AF.func("GetNextValidCol", col)) { 
                    if(col=="zbmc"||col=="xmgcid"||col=="jh") continue;
                    var title = form1.AF.func("GetColTitle", col);
                    titles += title + "\t";
                    var data = form1.AF.func("GetCellData", rows +"\r\n" + col);
                    if(data=="")
                        data = 0;
                    datas += data + "\t";
                }             
                form1.AF1.func("AddSeries", seriesname + "\r\n"+ titles + "\r\n" + datas);//柱状图
                AddSeries("合同金额");//饼图
            }            
        }
        function OnEvent(id, Event, p1, p2, p3, p4){
            if(id == "AF1" && Event == "Clicked" && p2 != ""){//点击柱状图时
                    form1.AF2.func("DeleteAllSeries", ""); 
                    AddSeries(p2);
            }
            if(id=="AF" && Event == "Clicked" && p2=="zbmc" && p3!="") {//点击超链接时
                var xmlbid =  document.AF.func("GetCellData", p1+"\r\nxmgcid\r\nfalse");
                var xmmc =  document.AF.func("GetCellData", p1+"\r\nzbmc\r\nfalse");
                var jh =  document.AF.func("GetCellData", p1+"\r\njh\r\nfalse");
                var nf ="<%=nf%>";
                var yf ="<%=yf%>";
                if(jh == "类别" || jh == "项目"){
	                form1.action = "TzzbIndex.aspx?xmlbid=" + escape(xmlbid) + "&xmmc=" + escape(xmmc) + "&nf=" + escape(nf) + "&yf=" + escape(yf);
                    form1.submit();
                }
                else{                   
                    if(jh!=""){
                        window.open('Zjmx.aspx?nf=' + escape(nf) + '&yf=' + escape(yf) + '&jh=' + escape(jh) + '&gcbm=' + escape(xmlbid), '', 'height=750,width=1020,top=50,left=100,toolbar=no,scrollbars,resizable=no,location=no'); 
                    }
                    else{
                        window.open('TzzbIndexGcmx.aspx?xmlbid=' + escape(xmlbid) + '&xmmc=' + escape(xmmc)+ '&nf=' + escape(nf) + '&yf=' + escape(yf),'','height=600,width=1000,top=100,left=100,toolbar=no,resizable=no,location=no');                      
                    }
                }	        
            }
            if(id=="AF2" && Event == "Clicked" && p2!="") {//点击饼图时
                var xmlbid =  "";
                var xmmc =  "";
                for(var row=form1.AF.func("GetNextValidRow", ""); row!=""; row=form1.AF.func("GetNextValidRow", row)) {
                    var zbmc = form1.AF.func("GetCellData", row +"\r\nzbmc");
                    zbmc=zbmc.replace(/(^\s*)|(\s*$)/g, "");    
                    if(zbmc == p2){
                        xmlbid =  document.AF.func("GetCellData", row+"\r\nxmgcid\r\nfalse");
                        xmmc =  document.AF.func("GetCellData",row+"\r\nzbmc\r\nfalse");
                        jh =  document.AF.func("GetCellData",row+"\r\njh\r\nfalse");
                        break;
                    }
                }
                var nf ="<%=nf%>";
                var yf ="<%=yf%>";            
	            if(jh == "类别" || jh == "项目"){
	                form1.action = "TzzbIndex.aspx?xmlbid=" + escape(xmlbid) + "&xmmc=" + escape(xmmc) + "&nf=" + escape(nf) + "&yf=" + escape(yf);
                    form1.submit();
                }
                else{
                   if(jh!=""){
                        window.open('Zjmx.aspx?nf=' + escape(nf) + '&yf=' + escape(yf) + '&jh=' + escape(jh) + '&gcbm=' + escape(xmlbid), '', 'height=800,width=1020,top=100,left=100,toolbar=no,scrollbars,resizable=no,location=no'); 
                    }
                    else{
                        window.open('TzzbIndexGcmx.aspx?xmlbid=' + escape(xmlbid) + '&xmmc=' + escape(xmmc)+ '&nf=' + escape(nf) + '&yf=' + escape(yf),'','height=600,width=1000,top=100,left=100,toolbar=no,resizable=no,location=no');                      
                    }                     
                }	                     
            }          
        }
        function AddSeries(p2)
        {
            var titles="", datas="";
            var seriesName =<%=nf %>+"年<%=xmmc %>"+p2+"构成图 （单位：万元）";
            for(var row=form1.AF.func("GetNextValidRow", ""); row!=""; row=form1.AF.func("GetNextValidRow", row)) {    
                var title = form1.AF.func("GetCellData", row +"\r\nzbmc");
                titles += title + "\t";
                var data = form1.AF.func("GetCellData", row +"\r\n" + p2);
                if(data=="")
                    data = 0;
                datas += data + "\t";
            }
            form1.AF2.func("AddSeries", seriesName + "\r\n" + titles + "\r\n" + datas);
        }
        function OpenXmyxdb()
        {
            var nf ="<%=nf%>";
            var yf ="<%=yf%>";
            window.open('Xmyxdb.aspx?nf=' + escape(nf) + '&yf=' + escape(yf),'','left=100,top=100,width=1000,height=600,toolbar=no,resizable=yes,location=no');
        }

         $(function () {
            $('#content').height(userScreenHeight);
        });
    </script>
</head>
<body>
    <form id="form1" runat="server" action="TzzbIndex.aspx" method="post">
    <div id="content" style="overflow: scroll; height: 100%">
        <div style="height: 5%; width: 100%">
            <asp:DropDownList ID="ddl_Owner" runat="server" Visible="false">
            </asp:DropDownList>
            <asp:DropDownList ID="ddl_Year" runat="server">
            </asp:DropDownList>
            <asp:DropDownList ID="ddl_Month" runat="server">
            </asp:DropDownList>
            <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
        </div>
        <div style="height: 90%; width: 100%">
            <div style="width: 70%; height: 5%; float: left">
                投资项目运行分析：
            </div>
            <div style="width: 30%; height: 5%; float: left">
                <input type="button" value="项目运行大表" onclick="OpenXmyxdb();" />
            </div>
            <div style="width: 100%; height: 10%; float: left">
                <p>
                    &nbsp;&nbsp;&nbsp;&nbsp;截止至<%=nf.ToString()%>年<%=yf.ToString() %>月，西北油田分公司累计下达计划<%=bnljjhtz.ToString() %>万元，累计完成投资<%=bnljsjtz.ToString() %>万元，完成计划的<%=bnjhwcl %>%。</p>
            </div>
            <div style="height: 40%; width: 50%; float: left">
                <script language="javascript" type="text/javascript">
                    insertChart('AF1', 'chart=1;textContent=3;bordercolor=#4499ff; borderWidth=2; borderRound=23;backcolor=#fff5ea,#f0e0d0;valueMask=####');
                </script>
            </div>
            <div style="height: 40%; width: 50%; float: left">
                <script language="javascript" type="text/javascript">
                    insertChart('AF2', 'chart=0;textContent=3;bordercolor=#4499ff; borderWidth=2; borderRound=23;backcolor=#fff5ea,#f0e0d0;valueMask=####');
                </script>
            </div>
            <div style="height: 47%; width: 100%">
                <script language="javascript" type="text/javascript">
                    insertTreeList('AF', '')            
                </script>
            </div>
            <div style="height: 5%; width: 100%">
                <input type="button" name="back" value="返回" onclick="window.history.go(-1);" />
            </div>
        </div>
    </div>
    </form>
</body>
</html>
